﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserManage.aspx.cs" Inherits="AdminManage_Manage_UserManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../css/all.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
        html,body
        {
            margin:0px;
            width:auto;
            height:auto;
            overflow-x:hidden;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div style="text-align: center" id="TableContent" runat="server">
            <table style="height: 100%; width: 100%; table-layout:fixed;" id="TheTable">
                <tr>
                    <td colspan="6"></td>
                    <td><asp:Button ID="btnAdd" runat="server" Text="添加用户" Height="22px"
                OnClick="OnAddRecordClick" /></td>
                </tr>
                <tr>
                    <td colspan="7">
            <hr />
            <asp:GridView runat="server" Width="100%" ID="gvData" AutoGenerateColumns="false" Font-Size="Small" AllowPaging="True" OnRowDeleting="gvData_RowDeleting" OnRowEditing="gvData_RowEditing" OnRowUpdating="gvData_RowUpdating" OnRowCancelingEdit="gvData_RowCancelingEdit">
                <Columns>

                    <asp:BoundField DataField="USER_ID" HeaderText="用户编号" />
                    <asp:BoundField DataField="LOGIN_NAME" HeaderText="账户" />
                    <asp:BoundField DataField="PASSWORD" HeaderText="密码" />
                    <asp:BoundField DataField="REAL_NAME" HeaderText="真实姓名" />
                    <asp:BoundField DataField="USERGROUP" HeaderText="用户角色" />
                    <%--<asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <span><%#Eval("")%></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <span><%#Eval("")%></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <span><%#Eval("")%></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <span><%#Eval("")%></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText=" ">
                    <ItemTemplate>
                        <span><%#Eval("USERGROUP")%></span>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                    <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                    <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />

                </Columns>
                <EmptyDataTemplate>
                    <asp:DetailsView runat="server" ID="dvData" AutoGenerateRows="False"
                        DefaultMode="Insert" OnItemInserting="dvData_ItemInserting"
                        OnModeChanging="dvData_ModeChanging" Width="50%">
                        <Fields>

                            <asp:TemplateField HeaderText="账户">
                                <InsertItemTemplate>
                                    <asp:TextBox ID="LOGIN_NAME" runat="server"></asp:TextBox>
                                </InsertItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="密码">
                                <InsertItemTemplate>
                                    <asp:TextBox ID="PASSWORD" runat="server"></asp:TextBox>
                                </InsertItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="真实姓名">
                                <InsertItemTemplate>
                                    <asp:TextBox ID="REAL_NAME" runat="server"></asp:TextBox>
                                </InsertItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="用户角色">
                                <InsertItemTemplate>
                                    <select id="USERGROUP" name="USERGROUP">
                                        <option value="1">超级管理员</option>
                                        <option value="0">普通用户
                                        </option>
                                    </select>
                                </InsertItemTemplate>
                            </asp:TemplateField>


                            <asp:CommandField ShowInsertButton="true" InsertText="录入" ShowCancelButton="true"
                                CancelText="返回" />
                        </Fields>
                    </asp:DetailsView>
                </EmptyDataTemplate>
            </asp:GridView>
                </td>
                </tr>
                </table>
        </div>
        <div id="ComUserDIV" style="display:none;" runat="server">
            非超级管理员，不能进行用户管理！
        </div>
    </form>
</body>
</html>
